
function  Promotion(){
   this.promotionName=[ "可口可乐","雪碧","方便面"];
}
Promotion.prototype={
    computePromotionCount:function(itemInfo){
        var promotionCount=(this.promotionName.indexOf(itemInfo.itemName)>-1)?parseInt(itemInfo.count/3):0;
        itemInfo.promotionCount=promotionCount;
        return itemInfo
    },
    computeSavePrice:function(itemInfo){
        var savePrice=itemInfo.price*itemInfo.promotionCount;
        itemInfo.savePrice=savePrice;
        return itemInfo
    }
}
